﻿<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data.OleDb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-all.css" />  
    <script type="text/javascript" src="../ext/ext-base.js"></script>
    <script type="text/javascript" src="../ext/ext-all.js"></script>
    <link rel="stylesheet" href="../Contents/Style.css" type="text/css" />
    <script language="JavaScript" charset='gb2312' src="../JSClass/FusionCharts.js"></script>
    <script>
function showmschart(url,divid){
	    Ext.Ajax.request({
           url: encodeURI(url),
           success: function(res){showmsdata(res,divid);},
           failure: fail
        });
        
	};
    function showmsdata(res,divid){
		var chartd = document.getElementById(divid);
		chartd.style.display = 'block';		
		var chart = new FusionCharts("../Charts/MSLine.swf", "ChartId", 380, 400, "0", "0");
		chart.setDataXML(res.responseText);					   
		chart.render(divid);                    		  		   
		
	}    
function showcolchart(url,divid){
	    Ext.Ajax.request({
           url: encodeURI(url),
           success: function(res){showcoldata(res,divid);},
           failure: fail
        });
        
	};
    function showcoldata(res,divid){
		var chartd = document.getElementById(divid);
		chartd.style.display = 'block';		
		var chart = new FusionCharts("../Charts/Column3D.swf", "ChartId", 380, 400, "0", "0");
		chart.setDataXML(res.responseText);					   
		chart.render(divid);                    		  		   
		
	}    	
	
    function init(){
       //showmschart("showchart.aspx?name=<%=Request.Params["name"] %>&year=2007",'chartdiv');
       showmschart("showchart.aspx?name=<%=Request.Params["name"] %>",'Div1');//&year=2008
       showcolchart("showtotalchart.aspx?name=<%=Request.Params["name"] %>",'Div2');
    }
    function fail(){}
    </script>
</head>
<body onload="init();">
    <%
        OleDbConnection conn = null;
        try
        {
            conn = DBOp.DbConn; 
            OleDbCommand comm = conn.CreateCommand();
            //comm.CommandText = "select * from jz2007 where 建筑统一编码 = '" + Request.Params["name"] + "'";
            comm.CommandText = "select * from jz where 建筑统一编码 = '" + Request.Params["name"] + "'";
            OleDbDataReader reader = comm.ExecuteReader();            
            if(reader.Read()){
                %>
                <table border="0px" style="font-size:12px">
                <% 
                    for(int i = 0; i < reader.FieldCount; i++){
                        string fieldname = reader.GetName(i).ToLower();
                        if (fieldname.StartsWith("y") || fieldname.StartsWith("t") || fieldname.StartsWith("o"))
                        {
                            continue;
                        }
                        string value = reader.GetValue(i).ToString();
                        if (value == "")
                            continue;
                        %>                        
                        <tr><td width='200px'><%=fieldname %></td><td><%=reader.GetValue(i) %></td></tr>
                        <%
                    }
                 %>
                 <tr><td colspan="2"><img onerror="this.parentNode.removeChild(this);" src="../照片/<%=reader.GetValue(reader.GetOrdinal("社区名")).ToString() %>/<%=reader.GetValue(reader.GetOrdinal("建筑统一编码")).ToString().Substring(12) %>.jpg" width="360px"/></td></tr>
                </table>
                <%
            }
         %>         
         <%}
        catch (Exception ex) { 
        
        }
        finally
        {
            if (conn != null)
                conn.Close();
        } %>
    <div id="chartdiv">
    </div>
    <div id="Div1">
    </div>
    <div id="Div2">
    </div>
</body>
</html>
